import { localRequest,request } from '@/utils'

const localGetChildrenList = function(){
    return localRequest({
        url:'/prt/childrenList.json',
        method:'GET'
    })
}

const getChildrenListAPI = function(token){
    return request({
        url:'/parent/bound_students',
        method:'GET',
        headers:{"Authorization": "Bearer " + token}
    })
}

const addChildrenAPI = (data,token) => {
    return request({
        url:'/parent/add_binding',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const cacelChildrenAPI = (student_id,token) => {
    return request({
        url:'/parent/unbind',
        method:'POST',
        data:{
            student_id
        },
        headers:{"Authorization": "Bearer " + token}
    })

}


const getChildrenCourseListAPI = (student_id,token) => {
    return request({
        url:'/parent/bound_students_course',
        method:'POST',
        data:{
            student_id
        },
        headers:{"Authorization": "Bearer " + token}
    })

} 

const getLearnConditionAPI = (data,token) => {
    return request({
        url:'/parent/bound_students_total_situation',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
    
}

const getPartList = (data,token) => {
    return request({
        url:'/parent/bound_students_part_situation',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}

const getInfo = (token) => {
    return request({
        url:'/parent_message',
        method:'GET',
        headers:{"Authorization": "Bearer " + token}
    })

}


const changeInfoAPI = (data,token) => {
    return request({
        url:'/parent_messageChange',
        method:'POST',
        data,
        headers:{"Authorization": "Bearer " + token}
    })
}


export {
    localGetChildrenList,
    getChildrenListAPI,
    addChildrenAPI,
    cacelChildrenAPI,
    getChildrenCourseListAPI,
    getLearnConditionAPI,
    getPartList,
    getInfo,
    changeInfoAPI
}